/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.neu.nutrons.lib;

/**
 *
 * @author NUTRONS_PROGRAMMING
 */
public class Helpers {
    public static double limitAbs(double in, double limit){
        if(limit < 0) limit *= -1;
        if( in < -limit) in = -limit;
        if( in > limit) in = limit;
        return in;
    }

    public static double limitAbs(double in){
        return limitAbs(in,1.0);
    }
}
